import request from '@/utils/request'

interface IUserInfoSuccess {
  status: number
  userInfo: IUserInfo
  roles: IRole[]
}

/**
 * 用户登录请求
 * @param account 
 * @returns 
 */
export const login = (account: ILoginAccount) => request<any, ILoginSuccess>({
  url: '/api/v1/admin/sessions',
  method: 'POST',
  data: account,
})

/**
 * 获取登录成功用户的信息
 */
export const getUserInfo = () => request<any, IUserInfoSuccess>({
  url: '/api/v1/admin/sessions/userinfo',
  method: 'GET',
})
